<template>
	<view>
		<my-navbar :name="nav_title" :back="false"></my-navbar>
		<my-page-loading :show="true" text="分享订单生成中..."></my-page-loading>
	</view>
</template>

<script>
	import { mapState } from 'vuex'
	import shareOrder from '../components/shareOrder.vue'
	export default {
		components:{
			shareOrder
		},
		data() {
			return {
				nav_title:'分享订单',
				id:0,						//分享的订单
			}
		},
		onLoad(option){
			if(option.id==undefined){
				this.$c.error('参数错误！','index')
				return false
			}else{
				this.id=option.id;
			}
			this.initData()
		},
		onShow(){
		},
		computed:{
			...mapState({
				
			})
		},
		methods: {
			initData(){
				let than=this
				//缓存临时订单的数据
				uni.$u.api.orderShareInfo({key:this.id}).then(res=>{
					this.$store.commit('setShareOrder',res.data)
					this.$c.a('flow/create/index','',2);
				}).catch(err=>{
					setTimeout(function(){
						than.$c.a('index','',2);
					},3000)
				});
			},
		}
	}
</script>

<style lang="scss">
	.page-place-order {
	    padding-top: 30rpx;
		padding-bottom: calc(130rpx + env(safe-area-inset-bottom));
		background-color: #ECEFF2;
	}
	
	/*线下支付*/
	.place-offline-payment {
	    display: block;
	    margin: 0 32rpx 32rpx;
	    padding: 32rpx;
	    background: #fff;
	    border-radius: 20rpx;
	}
	
	.place-offline-payment .header {
	    display: -ms-flexbox;
	    display: flex;
	    -ms-flex-align: center;
	    align-items: center;
	    background-size: 30rpx auto;
		margin-bottom: 32rpx;
	}
	
	.place-offline-payment .header .title {
	    display: block;
	    font-weight: 700;
	    font-size: 30rpx;
	}
	
	.place-offline-payment .row {
	    display: -ms-flexbox;
	    display: flex;
	    -ms-flex-align: center;
	    align-items: center;
	    padding-bottom: 18rpx;
	}
	
	.place-offline-payment .row .label {
	    display: block;
	    font-size: 26rpx;
	}
	
	.place-offline-payment .row .value {
	    display: block;
	    font-size: 26rpx;
	}
	
	.place-offline-payment .row .flex {
	    display: block;
	    flex: 1;
	    width: 100%;
	}
</style>
